package com.example.sunran.dataobject;


import org.apache.ibatis.jdbc.SQL;

public class PathQueryBuilder {

    public String buildQueryPath(String currentPath){
        return new SQL(){{
            SELECT(
                "id,parent,name,is_folder as isFolder"
            );
            FROM("path");
            if(currentPath==null){
                WHERE("parent=/");
            }else{
                WHERE("parent=#{currentPath}");
            }
        }}.toString();
    }
}
